import { request } from "@/utils/request";
//添加链接
export function addLink(params) {
    return request({
        method: 'post',
        url: '/link',
        data: params,
        headers: {
            'token': window.localStorage.token,
        },
    })
}
//获取关联词
export function getAssociatedWord(params) {
    return request({
        method: 'get',
        url: '/link/associated',
        params: params,
        headers: {
            'token': window.localStorage.token,
        },
    })
}
//获取文章内容
export function getEssayContent(params) {
    return request({
        method: 'get',
        url: '/link/content',
        params: params,
        headers: {
            'token': window.localStorage.token,
        },
    })
}
//获取文章列表
export function getEssays(params) {
    return request({
        method: 'get',
        url: '/link/essays',
        params: params,
        headers: {
            'token': window.localStorage.token,
        },
    })
}

export function getLinks() {
    return request({
        method: 'get',
        url: '/link',
        headers: {
            'token': window.localStorage.token,
        },
    })
}

export function delLink(params) {
    return request({
        method: 'delete',
        url: '/link',
        params:params,
        headers: {
            'token': window.localStorage.token,
        },
    })
}

export function getLinksByTitle(params){
    return request({
        method: 'get',
        url: '/link/title',
        params:params,
        headers: {
            'token': window.localStorage.token,
        },
    })
}